function out = getEquityPremData(setupFilter)
% Predicting excess returns by the slope of the yield curve (and pd)
maxHorizon         = 12;
pd                 = setupFilter.pdCash;
exReturn_annual    = setupFilter.retCash-setupFilter.rfCRSP;
%setupFilter.dataLabels(10),setupFilter.dataLabels(6)
slope                = setupFilter.data(:,10)-setupFilter.data(:,6);
regExR_on_pd         = zeros(maxHorizon,3);
regExR_on_pdR2       = zeros(maxHorizon,3);
regExR_on_slope      = zeros(maxHorizon,3);
regExR_on_slopeR2    = zeros(maxHorizon,3);
regExR_on_slope_pd   = zeros(maxHorizon,6);
regExR_on_slope_pdR2 = zeros(maxHorizon,3);

exR_z              = (exReturn_annual-mean(exReturn_annual))./std(exReturn_annual);
log_pd_z           = (log(pd)-mean(log(pd)))/std(log(pd));
slope_z            = (slope-mean(slope))/std(slope);
for j=1:maxHorizon
    results = predictRegress(exR_z,log_pd_z,j,j*2);
    regExR_on_pd(j,:)   = [results.beta(2,1) results.betapctile(2,1:2)];
    regExR_on_pdR2(j,:) = [results.rsqr results.R2pctile];

    results = predictRegress(exR_z,slope_z,j,j*2);
    regExR_on_slope(j,:)   = [results.beta(2,1) results.betapctile(2,1:2)];
    regExR_on_slopeR2(j,:) = [results.rsqr results.R2pctile];

    results = predictRegress(exR_z,[slope_z log_pd_z],j,j*2);
    regExR_on_slope_pd(j,:)   = [results.beta(2,1) results.betapctile(2,1:2) ...
                                 results.beta(3,1) results.betapctile(3,1:2)];
    regExR_on_slope_pdR2(j,:) = [results.rsqr results.R2pctile];
end
out.pd                   = pd;
out.exReturn_annual      = exReturn_annual;
out.regExR_on_pd         = regExR_on_pd;
out.regExR_on_pdR2       = regExR_on_pdR2;
out.regExR_on_slope      = regExR_on_slope;
out.regExR_on_slopeR2    = regExR_on_slopeR2;
out.regExR_on_slope_pd   = regExR_on_slope_pd;
out.regExR_on_slope_pdR2 = regExR_on_slope_pdR2;
out.horizon              = 1:maxHorizon;
posInfl                  = find(strcmp(setupFilter.dataLabels,"$\pi_t$"));
out.meanRet              = mean(setupFilter.retCash - setupFilter.data(:,posInfl));
out.stdRet               = std(setupFilter.retCash - setupFilter.data(:,posInfl));
out.meanExcessRet        = mean(exReturn_annual);
out.stdExcessRet         = std(exReturn_annual);



end